package com.ego.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ego.common.vo.PageVo;
import com.ego.product.po.SpuInfo;
import com.ego.product.vo.SpuInfoSearchVo;
import com.ego.product.vo.spu.SpuSaveVo;

import java.util.concurrent.ExecutionException;

/**
 * @program: ego
 * @description spu信息服务层
 * @author KamTang
 * @date 2022-11-13 12:56:14
 */
public interface SpuInfoService extends IService<SpuInfo> {
    /**
     * 保存商品 —— 商品商家主要功能
     * @param vo @see
     * @throws ExecutionException 异步异常
     * @throws InterruptedException 异步异常
     * @see SpuSaveVo
     */
    void saveSpu(SpuSaveVo vo) throws ExecutionException, InterruptedException;

    /**
     * 分页搜索Spu信息
     * @param search @see
     * @return spu信息
     * @see SpuInfoSearchVo
     */
    PageVo<SpuInfo> search(SpuInfoSearchVo search);

    /**
     * 商品出售（上架）
     * @param spuId spuId
     */
    void sale(Long spuId);

    /**
     * 根据skuId获取spu信息
     * @param skuId skuId
     * @return @see
     * @see SpuInfo
     */
    SpuInfo get(Long skuId);
}

